HTTP Request
AutomatR.DeafultActivities.API.HTTPRequest
The "HTTP Request" activity in AutomatR facilitates performing HTTP requests to a specified web API. This versatile activity supports various request methods such as GET, POST, and DELETE, allowing users to interact with APIs and retrieve responses for further processing.
Properties
Name | Description |
---|---|
Input | |
Body | Specifies the body of the HTTP request as a string . This property is required for POST requests and can be used for other methods as needed. |
URL | Specifies the endpoint URL to which the HTTP request should be sent. Provide a string variable containing the URL. This property is required. |
Headers | Specifies custom headers to include in the HTTP request. Enter headers in dictionary format, where the keys represent header names and values represent header values. |
Method | Specifies the HTTP request method to be used when calling the API (e.g., POST, DELETE, GET). This property is required. |
FormData | Allows entering form data through a wizard. This property is optional and can be configured for specific use cases, especially for POST requests. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "HTTP Request" activity. This optional delay can be used to manage synchronization or pacing issues. Integer variables containing the delay duration (e.g., 5 for 5 seconds). |
Output | |
Response | Outputs the response received from the HTTP request as a string variable. This variable contains the HttpResponseMessage from the API call, providing details about the response. |
How to use:
- Drag and drop the "HTTP Request" activity onto the workflow.
- Configure the properties by specifying the URL, method, headers, body, and any optional parameters.
- Optionally, configure the delay to control the timing of the HTTP request.
- Execute the workflow to perform the HTTP request and retrieve the response.
Example: Consider an example where the "HTTP Request" activity is used to send a POST request to an API endpoint:
HTTP Request:
URL: "https://api.example.com/data"
Method: POST
Headers:
- Key: "Authorization"
Value: "Bearer {your_access_token}"
- Key: "Content-Type"
Value: "application/json"
Body: "{ 'key': 'value' }"
Delay: 2
Response: apiResponse
In this example, the activity sends a POST request to "https://api.example.com/data" with specified headers and a JSON body. The response from the API is stored in the variable apiResponse
for further processing in the workflow.